
#!/bin/bash

# 设置 Toolkit 和自定义头文件路径
ASCEND_TOOLKIT_PATH=$HOME/Ascend/ascend-toolkit/8.0.0/x86_64-linux
GELU_CUSTOM_PATH=$HOME/code/cann-ops/src/math/gelu/op_host

# 创建并进入 build 目录
mkdir -p build
cd build
rm -rf *

# 编译配置
cmake .. \
	  -DCMAKE_CXX_FLAGS="-I${ASCEND_TOOLKIT_PATH}/include -I${GELU_CUSTOM_PATH}" \
	    -DCMAKE_EXE_LINKER_FLAGS="-L${ASCEND_TOOLKIT_PATH}/lib64"

# 编译
make

